package Class_03_15;

import java.util.Scanner;

public class ndarray {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请依次输入十个数");
        int[] arr1 = new int[10];
        for (int i = 0; i < arr1.length; i++) {
            arr1[i] = sc.nextInt();
        }
        int[] arr2 = new int[arr1.length];
        int flag2 = 0;
        int flag1 = 0;
        int flag = 1;
        arr2[flag2 ++] = arr1[flag1];
        for (int i = 1; i < arr1.length; i++) {
            for (int j = 0; j < flag2; j++) {
                if(arr1[i] == arr2[j])
                {
                    flag = 0;
                    break;
                }
            }
            if(flag == 1)
            {
                arr2[flag2++] = arr1[i];
            }
        }
        for (int i = 0; i < flag2; i++) {
            System.out.printf("%d ",arr2[i]);
        }
    }
}
